package fr.cie.blog.domainservice;

import java.util.List;

/**
 * @author AetM
 * 
 * @param <Type>
 *            generic type
 */
public interface IServiceGeneric<Type> {

	/**
	 * @param object
	 *            the object to create
	 * @return 1 in SUCCESS, 0 otherwise
	 */
	int save(Type object);

	/**
	 * @param object
	 *            the object to save
	 * @return 1 in SUCCESS, 0 otherwise
	 */
	int update(Type object);

	/**
	 * @param object
	 *            the object to delete
	 * @return 1 in SUCCESS, 0 otherwise
	 */
	int delete(Type object);

	/**
	 * 
	 * all instances of the type of this object.
	 * 
	 * @return the list of objects
	 */
	List<Type> findAll();

	/**
	 * @param identifier
	 *            object's id
	 * @return the instance which matches with the id
	 */
	Type findById(long identifier);

}